package java_9_9.Test_4;


import oracle.jrockit.jfr.StringConstantPool;

import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        Company c=new Company("香岛","临泉路888号","8888888","食品");
        System.out.println("欢迎光临");
        System.out.println(c.toString());
        Scanner in=new Scanner(System.in);
        while (true){
            System.out.println("添加员工请按1，输出员工信息请按2，辞退员工请按3，统计公司人数请按4，获得薪水最高的员工请按5,查看最大年龄员工请按6，退出请按9");
            int a=in.nextInt();
            switch (a){
                case 1:
                    System.out.println("请输入要删除的员工信息");
                    boolean b = c.add(new Staff(in.next(), in.nextInt(), in.next(), in.nextDouble(), in.next()));
                    if (b==true){
                        System.out.println("添加成功");
                    }else{
                        System.out.println("添加失败");
                        break;
                    }
                case 2:
                    c.show();
                    break;
                case 3:
                    System.out.println("请输入要删除的员工的编号");
                    boolean b1 = c.delet(in.next());
                    if (b1==true){
                        System.out.println("删除成功");
                    }else{
                        System.out.println("删除失败");
                    }
                    break;
                case 4:
                    System.out.println(c.rs());
                    break;
                case 5:
                    System.out.println(c.max());
                    break;
                case 6:
                    System.out.println(c.maxAge());
                case 9:
                    break;
            }
        }
    }
}
